3.203 \(\int \cot ^5(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=76 \[ -\frac{a^2 \cot ^4(e+f x)}{4 f}+\frac{a (a-2 b) \cot ^2(e+f x)}{2 f}+\frac{(a-b)^2 \log (\tan (e+f x))}{f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f} \]

[Out]

(a*(a - 2*b)*Cot[e + f*x]^2)/(2*f) - (a^2*Cot[e + f*x]^4)/(4*f) + ((a - b)^2*Log[Cos[e + f*x]])/f + ((a - b)^2
*Log[Tan[e + f*x]])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0883688, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 88} \[ -\frac{a^2 \cot ^4(e+f x)}{4 f}+\frac{a (a-2 b) \cot ^2(e+f x)}{2 f}+\frac{(a-b)^2 \log (\tan (e+f x))}{f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^5*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(a*(a - 2*b)*Cot[e + f*x]^2)/(2*f) - (a^2*Cot[e + f*x]^4)/(4*f) + ((a - b)^2*Log[Cos[e + f*x]])/f + ((a - b)^2
*Log[Tan[e + f*x]])/f

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin{align*} \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{x^5 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^2}{x^3 (1+x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a^2}{x^3}-\frac{a (a-2 b)}{x^2}+\frac{(a-b)^2}{x}-\frac{(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{a (a-2 b) \cot ^2(e+f x)}{2 f}-\frac{a^2 \cot ^4(e+f x)}{4 f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{(a-b)^2 \log (\tan (e+f x))}{f}\\ \end{align*}

Mathematica [A]  time = 0.289288, size = 61, normalized size = 0.8 \[ \frac{-a^2 \cot ^4(e+f x)+2 a (a-2 b) \cot ^2(e+f x)+4 (a-b)^2 (\log (\tan (e+f x))+\log (\cos (e+f x)))}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^5*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(2*a*(a - 2*b)*Cot[e + f*x]^2 - a^2*Cot[e + f*x]^4 + 4*(a - b)^2*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/(4*f
)

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 91, normalized size = 1.2 \begin{align*}{\frac{{b}^{2}\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{ab \left ( \cot \left ( fx+e \right ) \right ) ^{2}}{f}}-2\,{\frac{ab\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{{a}^{2} \left ( \cot \left ( fx+e \right ) \right ) ^{4}}{4\,f}}+{\frac{{a}^{2} \left ( \cot \left ( fx+e \right ) \right ) ^{2}}{2\,f}}+{\frac{{a}^{2}\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*b^2*ln(sin(f*x+e))-1/f*a*b*cot(f*x+e)^2-2/f*a*b*ln(sin(f*x+e))-1/4*a^2*cot(f*x+e)^4/f+1/2*a^2*cot(f*x+e)^2
/f+1/f*a^2*ln(sin(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.07737, size = 82, normalized size = 1.08 \begin{align*} \frac{2 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{4 \,{\left (a^{2} - a b\right )} \sin \left (f x + e\right )^{2} - a^{2}}{\sin \left (f x + e\right )^{4}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/4*(2*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2) + (4*(a^2 - a*b)*sin(f*x + e)^2 - a^2)/sin(f*x + e)^4)/f

________________________________________________________________________________________

Fricas [A]  time = 1.059, size = 238, normalized size = 3.13 \begin{align*} \frac{2 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} +{\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (f x + e\right )^{4} + 2 \,{\left (a^{2} - 2 \, a b\right )} \tan \left (f x + e\right )^{2} - a^{2}}{4 \, f \tan \left (f x + e\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/4*(2*(a^2 - 2*a*b + b^2)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1))*tan(f*x + e)^4 + (3*a^2 - 4*a*b)*tan(f*x +
 e)^4 + 2*(a^2 - 2*a*b)*tan(f*x + e)^2 - a^2)/(f*tan(f*x + e)^4)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**5*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.6882, size = 420, normalized size = 5.53 \begin{align*} -\frac{\frac{12 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{16 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 64 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right ) - 32 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{{\left (a^{2} + \frac{12 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{16 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{48 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{96 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{48 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}}{64 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/64*(12*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 16*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a^2*(cos(
f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 64*(a^2 - 2*a*b + b^2)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)
- 32*(a^2 - 2*a*b + b^2)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + (a^2 + 12*a^2*(cos(f*x + e) - 1)/(cos(f
*x + e) + 1) - 16*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 48*a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2
 - 96*a*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 48*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)*(cos(f
*x + e) + 1)^2/(cos(f*x + e) - 1)^2)/f